var VipUserItemsTable = {
    id: "vipUserItemsTable",//表格id
    seItem: null,		//选中的条目
    me : "",

    width: '750px',
    height: '600px',
    currentLayerIndex: -1,
    cache: "",
    InfoData: {}
};

/**
 * 初始化新增弹出框
 */
VipUserItemsTable.initView = function () {
    this.cache = $("#vipUserItemsDialog").html();
    $("#vipUserItemsDialog").html('');
};


/**
 * 初始化整个表格
 */
VipUserItemsTable.init = function(dataId){
    var defaultColunms = this.initColumn();
    var bstable = new BSTable(VipUserItemsTable.id,Feng.ctxPath+"/course/userByCourseId",defaultColunms);
    bstable.setData({courseId:dataId});
    bstable.setHeight("500");
    this.me = bstable.init();
};

/**
 * 初始化表格的列
 */
VipUserItemsTable.initColumn = function(){
    var columns = [
        {
            title: '序号', align: 'center', valign: 'middle',
            formatter: function indexFormatter(value, row, index) {//在表格前加上序号
                return index + 1;
            }
        },
        {title: '订单号', field: 'orderNum', align: 'center', valign: 'middle'},
        {title: '用户名', field: 'name', align: 'center', valign: 'middle'},
        {
            title: '性别', field: 'sex', align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                if (value === "0") {
                    return "未知";
                } else if (value === "1") {
                    return "男";
                } else if (value === '2') {
                    return "女";
                }
            }
        },
        {title: '家长名称', field: 'parentsName', align: 'center', valign: 'middle'},
        {title: '家长电话', field: 'parentsPhone', align: 'center', valign: 'middle'},
        {
            title: '注册方式', field: 'regType', align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                if (value === "WeChat") {
                    return "微信";
                } else if (value === "APP") {
                    return "APP注册";
                } else if (value === 'BackGround') {
                    return "后台";
                }
            }
        },
        {title: '注册时间', field: 'createDate', align: 'center', valign: 'middle'}
        ];
    return columns;
};


